#include <cstdio>  
#include <iostream>  
#include <cstring>   
#define MAX 110  
using namespace std;  
  
char board[MAX][MAX];  
int sum[MAX][MAX];  
  
int main(void)  
{     
  int n;  
  while(~scanf("%d",&n))  
  {  
    memset(sum,0,sizeof(sum));  
    memset(board,'#',sizeof(board));  
    getchar();  
    for(int i=1;i<=n;++i)  
      gets(board[i]+1);  
  
        int ans=0;  
  
        for(int i=1;i<=n;++i)  
            for(int j=1;j<=n;++j)  
                if(board[i][j]=='.')  
                {  
                    if(board[i][j-1]!='.')  
                        sum[i][j]=1;  
                    else  
            sum[i][j]=sum[i][j-1]+1;  
                }  
  
        for(int i=1;i<=n;++i)  
            for(int j=1;j<=n;++j)  
            {  
                int len=0x3f3f3f3f;  
                for(int k=i;k<=n && sum[k][j];++k)  
                {  
                    len=min(len,sum[k][j]);  
                    ans+=len;  
                }  
            }  
        printf("%d\n",ans);  
  }  
  
  return 0;  
}  
